<nz-modal [(nzVisible)]="isVisible" nzTitle="新增|编辑" [nzOkLoading]="nzOkLoading" (nzOnCancel)="this.editCancel.emit()" (nzOnOk)="submitForm()">
  <ng-template nzModalContent>
    <form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm()">
      <nz-form-item>
        <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="username">账号</nz-form-label>
        <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="账号为必填项!">
          <input nz-input formControlName="username" id="username" placeholder="请输入账号" />
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="roles">角色</nz-form-label>
        <nz-form-control [nzSm]="14" [nzXs]="24">
          <nz-select formControlName="roles" nzPlaceHolder="选择角色">
            <nz-option *ngFor="let item of listOfRole" [nzValue]="item._id" [nzLabel]="item.name">123</nz-option>
          </nz-select>
        </nz-form-control>
      </nz-form-item>
      <!-- <nz-form-item *ngIf="!data">
      <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="password"
        >密码</nz-form-label
      >
      <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="密码为必填项!">
        <input nz-input formControlName="password" id="password" readonly />
      </nz-form-control>
    </nz-form-item> -->
      <nz-form-item>
        <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="realname">真实姓名</nz-form-label>
        <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="真实姓名为必填项!">
          <input nz-input formControlName="realname" id="realname" placeholder="请输入真实姓名" />
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="mobile">手机号</nz-form-label>
        <nz-form-control [nzSm]="14" [nzXs]="24" [nzErrorTip]="mobileErrorTpl">
          <input nz-input formControlName="mobile" id="mobile" placeholder="请输入手机号" />
          <ng-template #mobileErrorTpl let-control>
            <ng-container *ngIf="control.hasError('pattern')">
              手机号格式不正确!
            </ng-container>
          </ng-template>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="email">邮箱</nz-form-label>
        <nz-form-control [nzSm]="14" [nzXs]="24" [nzErrorTip]="emailErrorTpl">
          <input nz-input formControlName="email" id="email" placeholder="请输入邮箱" />
          <ng-template #emailErrorTpl let-control>
            <ng-container *ngIf="control.hasError('email')">
              邮箱格式不正确!
            </ng-container>
          </ng-template>
        </nz-form-control>
      </nz-form-item>
    </form>
  </ng-template>
</nz-modal>